package com.zhuxiang.test2;

public class Test {
    public static void main(String[] args) {
        PhoneCard pc = new PhoneCard(PhoneCardEnum.SMALL.getType(),"13113111123","张三","123456",100,50,100);
        pc.show();
        System.out.println("----------------------------------");
        //父类引用指向子类对象
        PhonePlans pp = new CallPlan(11,12);
        pp.setRate(20);
        pp.show();
        System.out.println("----------------------------------");
        PhonePlans pp1 = new InterPlan(20);
        pp1.setRate(50);
        pp1.show();
        System.out.println("------------------------------");
        //接口指向实现类
        CallService cs = new CallPlan(500,100);
        int a = cs.call(200,PhoneCardEnum.BIG.getType());
        System.out.println("------------------------------");
        InterService is = new InterPlan(1024);
        int b = is.inter(50,PhoneCardEnum.MICRO.getType());
        System.out.println("------------------------------");
        ConsumerInfo info = new ConsumerInfo(a,b,pp.getRate()+pp1.getRate());
        info.show();

    }
}
